<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>1</title>
	</head>
	<body>
		<script>
			var name="五年间，，，，，，。";
			var acount=0;
			var weizhi=name.indexOf("，");
			
			while(weizhi!=-1){
				weizhi=name.indexOf("，",weizhi+1);
				acount++;
			}
			alert(acount);
		</script>
	</body>
</html>
